
/**
 * 全局变量
 */
var storageLocalName = ''; //库位名称
var dIds = new Array();//删除了的入库产品信息ID数组
var i = 0;//数组下标
var supplierName = '';//供应商名称
var supplierId = '';
var pageNoOne;
var pageSizeOne;
var countOne;

/**
 * 保存
 */
function save(){
	var json = "";
	var supplierName = $("input[name=supplierName]").val();
	var docMaker = $("input[name=docMaker]").val();
	var inStorageType = $("select[name=inStorageTypeId]").val();
	if(supplierName == ''){
		$.jBox.tip("请填写供应商名称");
		return;
	}
	if(docMaker == ''){
		$.jBox.tip("请填写制单人名称");
		return;
	}
	if(inStorageType == ''){
		$.jBox.tip("请选择入库单类型");
		return;
	}
	$.each($("#productInfoTbody tr"), function(i,info){
		var productInfoId = $("#productInfoTbody tr:eq("+i+") input[name=productInfoId]").val();//产品ID
		var storageLocalID = $("#productInfoTbody tr:eq("+i+") input[name=storageLocalID]").val();//库位ID
		var inStorageDetailID = $("#productInfoTbody tr:eq("+i+") input[name=inStorageDetailID]").val();//入库产品信息ID
		var batch = $("#productInfoTbody tr:eq("+i+") span[class=batchSpan]").html();//产品批次
		var price = $("#productInfoTbody tr:eq("+i+") span[class=priceSpan]").html();//产品单价
		var count = $("#productInfoTbody tr:eq("+i+") span[class=countSpan]").html();//入库数量
		if(i != 0){
			json = json+','
		}
		json = json+'{"productInfoId":"'+productInfoId+'","storageLocalID":"'+storageLocalID+'","inStorageDetailID":"'+inStorageDetailID+
				'","batch":"'+batch+'","price":"'+price+'","count":"'+count+'",}';
	});
	var inStorageDetail = '['+json+']';
	$("input[name=inStorageDetail]").val(inStorageDetail);
	$("input[name=ids]").val(dIds);
	$("#saveForm").submit();	//提交表单	
}

/**
 * 添加产品框
*/
function addPro(){
	$.jBox($("#divPro").html(), {
		id: 'JBoxDivPro', 
		title : "添加入库信息",
		width : 555,
		height : 570,
		buttons : {"选择" : false , "关闭" : true },
		submit : function(v, h, f) {
			if (v == false) {
				if(h.find("#storageLocalID").val() == ''){
					$.jBox.tip("请选择库位", "warn");
					return false;
				}
				if(h.find("#productId").val() != ''){
					var newRow = '<tr><td>'
						+'<input type="hidden" name="inStorageDetailID" value="" />'
						+'<input type="hidden" name="productInfoId" value="'+h.find("#productId").val()+'" />'
						+'<input type="hidden" name="storageLocalID" value="'+h.find("#storageLocalID").val()+'" />'
						+'<span class="productInfoNameSpan">'+h.find("#productName").val()+'</span>'
						+'</td>'
						+'<td><span class="productCodeSpan">'+h.find("#productCode").val()+'</span></td>'
						+'<td><span class="specificationsSpan">'+h.find("#specifications").val()+'</span></td>'
						+'<td><span class="brandSpan">'+h.find("#brand").val()+'</span></td>'
						+'<td><span class="packagingSpan">'+h.find("#packaging").val()+'</span></td>'
						+'<td><span class="batchSpan">'+h.find("#batch").val()+'</span></td>'
						+'<td><span class="priceSpan">'+h.find("#price").val()+'</span></td>'
						+'<td><span class="countSpan">'+h.find("#count").val()+'</span></td>'
						+'<td><span class="countSpan">'+h.find("#count").val() * h.find("#price").val()+'</span></td>'
						+'<td><span class="storageLocalNameSpan">'+h.find("#storageLocalName").val()+'</span></td>'
						+'<td>'
							+'<a href="javascript:" onclick="modifyInStorageDetail(this)"><i class="icon-edit"></i></a>&nbsp; '
							+'<a href="javascript:" class="deleteRow"><i class="icon-remove"></i></a>'
						+'</td></tr>';
					$("#productInfoTbody").append(newRow);
					$("#productId").attr("value","");
					$("#productName").attr("value","");
					$("#productCode").attr("value","");
					$("#specifications").attr("value","");
					$("#brand").attr("value","");
					$("#packaging").attr("value","");
					$("#batch").val("");
					$("#count").val("");
					$("#price").val("");
					$("#storageLocalName").attr("value","");
					$("#storageLocalID").attr("value","");
					return true;
				}else{
					$.jBox.tip("请选择产品", "warn");
					return false;
				}
			}else {
				return true;
			}
		}
	});
}

/**
 * 修改入库产品信息
 */
function modifyInStorageDetail(obj){
	$("#productIds").attr("value",$(obj).parent().parent().children("td").children("input[name=productInfoId]").val());
	$("#productNames").attr("value",$(obj).parent().parent().children("td").children("span[class=productInfoNameSpan]").html());
	$("#productCodes").attr("value",$(obj).parent().parent().children("td").children("span[class=productCodeSpan]").html());
	$("#specificationss").attr("value",$(obj).parent().parent().children("td").children("span[class=specificationsSpan]").html());
	$("#brands").attr("value",$(obj).parent().parent().children("td").children("span[class=brandSpan]").html());
	$("#packagings").attr("value",$(obj).parent().parent().children("td").children("span[class=packagingSpan]").html());
	$("#batchs").attr("value",$(obj).parent().parent().children("td").children("span[class=batchSpan]").html());
	$("#counts").attr("value",$(obj).parent().parent().children("td").children("span[class=countSpan]").html());
	$("#prices").attr("value",$(obj).parent().parent().children("td").children("span[class=priceSpan]").html());
	$("#storageLocalNames").attr("value",$(obj).parent().parent().children("td").children("span[class=storageLocalNameSpan]").html());
	$("#storageLocalIDs").attr("value",$(obj).parent().parent().children("td").children("input[name=storageLocalID]").val());
	ejectModifyInStorageDetail(obj);
}

/**
 * 弹出修改入库产品框
 */
function ejectModifyInStorageDetail(obj){
	$.jBox($("#divModifyPro").html(), {
		id: 'JBoxModifyPro', 
		title : "修改入库信息",
		width : 555,
		height : 570,
		buttons : {"选择" : false , "关闭" : true },
		submit : function(v, h, f) {
			if (v == false) {
				if(h.find("#storageLocalIDs").val() == ''){
					$.jBox.tip("请选择库位", "warn");
					return false;
				}
				if(h.find("#productIds").val() != ''){
					$(obj).parent().parent().children("td").children("input[name=productInfoId]").val(h.find("#productIds").val());
					$(obj).parent().parent().children("td").children("span[class=productInfoNameSpan]").html(h.find("#productNames").val());
					$(obj).parent().parent().children("td").children("span[class=productCodeSpan]").html(h.find("#productCodes").val());
					$(obj).parent().parent().children("td").children("span[class=specificationsSpan]").html(h.find("#specificationss").val());
					$(obj).parent().parent().children("td").children("span[class=brandSpan]").html(h.find("#brands").val());
					$(obj).parent().parent().children("td").children("span[class=packagingSpan]").html(h.find("#packagings").val());
					$(obj).parent().parent().children("td").children("span[class=batchSpan]").html(h.find("#batchs").val());
					$(obj).parent().parent().children("td").children("span[class=countSpan]").html(h.find("#counts").val());
					$(obj).parent().parent().children("td").children("span[class=priceSpan]").html(h.find("#prices").val());
					$(obj).parent().parent().children("td").children("span[class=storageLocalNameSpan]").html(h.find("#storageLocalNames").val());
					$(obj).parent().parent().children("td").children("input[name=storageLocalID]").val(h.find("#storageLocalIDs").val());
					var count = h.find("#counts").val();//数量
					var price = h.find("#prices").val();//价格
					$(obj).parent().parent().children("td").children("span[class=TotalSpan]").html(count * price);
					$("#productIds").attr("value","");
					$("#productNames").attr("value","");
					$("#productCodes").attr("value","");
					$("#specificationss").attr("value","");
					$("#brands").attr("value","");
					$("#packagings").attr("value","");
					$("#batchs").val("");
					$("#counts").val("");
					$("#prices").val("");
					$("#storageLocalNames").attr("value","");
					$("#storageLocalIDs").attr("value","");
					return true;
				}else{
					$.jBox.tip("请选择产品", "warn");
					return false;
				}
			}else {
				return true;
			}
		}
	});
}

/**
 * 弹出库位信息框
 */
function ejectStorageInfo(){
	$.jBox($("#divStorageInfo").html(), {
		id: 'jBoxStorageInfo', 
		title : "选择库位",
		width : 'auto',
		height : 'auto',
		buttons : {"选择" : false , "关闭" : true },
		submit : function(v, h, f) {
			if (v == false) {
				if(h.find("input[name='radio']:checked").val() != null){
					var $subBox = h.find("input[name='radio']:checked");
    				$("#storageLocalName").attr("value",$subBox.parent().parent().children("td")[1].innerHTML);
    				$("#storageLocalID").attr("value",$subBox.val());
    				$.jBox.close(jBoxStorageInfo);
    				addPro();
    				return true;
				}else{
					$.jBox.tip("请选择库位！", "warn");
					return false;
				}
			}
		}
	});
}


/**
 * 弹出联系人信息框
 */
function ejectSupplierContactsInfo(){
	$.jBox($("#divSupplierContactsInfo").html(), {
		id: 'jBoxSupplierContactsInfo', 
		title : "选择联系人",
		width : 'auto',
		height : 'auto',
		buttons : {"选择" : false , "关闭" : true },
		submit : function(v, h, f) {
			if (v == false) {
				if(h.find("input[name='radio']:checked").val() != null){
					var $subBox = h.find("input[name='radio']:checked");
    				$("#supplierContactsName").attr("value",$subBox.parent().parent().children("td")[1].innerHTML);
    				$("#supplierContactsId").attr("value",$subBox.val());
    				return true;
				}else{
					$.jBox.tip("请选择供应商！", "warn");
					return false;
				}
			}
		}
	});
}

/**
 * 双击选择联系人
 */
$("#supplierContactsName").live('dblclick',function(){
	var supplierId = $("#supplierId").val();
	$("#supplierContactsTbody").html("");
	if(typeof(supplierId) == "undefined" || supplierId == ''){
		$.jBox.tip("请先选择供应商！", "warn");
		return;
	}
	var newRows = '';
	$.getJSON("/jeesite/a/en/inStorageDetail/supplierContactsList","id="+supplierId,function(data){
		if (typeof(data.list) != "undefined" && data.list.length >= 1){
			$.each(data.list, function(i,info){
				newRows += '<tr><td style="width: 8px;"><input type="radio"class="subBox" name="radio" value="'+info.id+'"/></td><td>'+info.name+'</td>'
					+'<td>'+info.phone+'</td>'
					+'<td>'+info.email+'</td>'
					+'<td>'+info.phone+'</td>'
			});
		}
		$("#supplierContactsTbody").append(newRows);
		pageNoOne = data.pageNo;
		pageSizeOne = data.pageSize;
		countOne = data.count;
		$("#clientelePageNo").html(pageNoOne);
		$("#clientelePageSize").html(pageSizeOne);
		$("#clienteleCount").html(countOne);
		if(pageNoOne <= 1){
			$("#clientelePreviousPageLi").attr("class","disabled");
		}
		if(pageNoOne >= countOne/pageSizeOne){
			$("#clienteleNextPageLi").attr("class","disabled");
		}
		//弹出选择框
		ejectSupplierContactsInfo();
	});
});

/**
 * 弹出供应商信息框
 */
function ejectSupplierInfo(){
	$.jBox($("#divSupplierInfo").html(), {
		id: 'jBoxSupplierInfo', 
		title : "选择供应商",
		width : 'auto',
		height : 'auto',
		buttons : {"选择" : false , "关闭" : true },
		submit : function(v, h, f) {
			if (v == false) {
				if(h.find("input[name='radio']:checked").val() != null){
					var $subBox = h.find("input[name='radio']:checked");
    				$("#supplierName").attr("value",$subBox.parent().parent().children("td")[1].innerHTML);
    				$("#supplierContactsPhone").attr("value",$subBox.parent().parent().children("td")[2].innerHTML);
    				$("#supplierId").attr("value",$subBox.val());
    				return true;
				}else{
					$.jBox.tip("请选择供应商！", "warn");
					return false;
				}
			}
		}
	});
}

/**
 * 双击选择供应商
 */
$("#supplierCodeNum").live('dblclick',function(){
	$("#supplierTbody").html("");
	var newRows = '';
	$.getJSON("/jeesite/a/en/inStorageDetail/supplierList",function(data){
		if (typeof(data.list) != "undefined" && data.list.length >= 1){
			$.each(data.list, function(i,info){
				newRows += '<tr><td style="width: 8px;"><input type="radio"class="subBox" name="radio" value="'+info.id+'"/></td><td>'+info.name+'</td>'
					+'<td>'+info.phone+'</td>'
					+'<td>'+info.email+'</td>'
					+'<td>'+info.phone+'</td>'
					+'<td>'+info.address+'</td>'
					+'<td>'+info.website+'</td>';
			});
		}
		$("#supplierTbody").append(newRows);
		pageNoOne = data.pageNo;
		pageSizeOne = data.pageSize;
		countOne = data.count;
		$("#clientelePageNo").html(pageNoOne);
		$("#clientelePageSize").html(pageSizeOne);
		$("#clienteleCount").html(countOne);
		if(pageNoOne <= 1){
			$("#clientelePreviousPageLi").attr("class","disabled");
		}
		if(pageNoOne >= countOne/pageSizeOne){
			$("#clienteleNextPageLi").attr("class","disabled");
		}
		//弹出选择框
		ejectSupplierInfo();
	});
});

/**
 * 搜索供应商
 * @param obj
 */
function selectStorage(obj){
	supplierName = $(obj).prev().val();
	$("#clienteleTbody").html(" ");
	var  newRow = "";
	$.getJSON("/jeesite/a/en/inStorageDetail/supplierList","name="+supplierName,function(data){
		if (typeof(data.list) != "undefined" && data.list.length >= 1){
			$.each(data.list, function(i,info){
				newRows += '<tr><td style="width: 8px;"><input type="radio"class="subBox" name="radio" value="'+info.id+'"/></td><td>'+info.name+'</td>'
					+'<td>'+info.phone+'</td>'
					+'<td>'+info.email+'</td>'
					+'<td>'+info.phone+'</td>'
					+'<td>'+info.address+'</td>'
					+'<td>'+info.website+'</td>';
			});
		}
		$("#storageTbody").append(newRow);
		pageNoOne = data.pageNo;
		pageSizeOne = data.pageSize;
		countOne = data.count;
		$("#clientelePageNo").html(pageNoOne);
		$("#clientelePageSize").html(pageSizeOne);
		$("#clienteleCount").html(countOne);
		if(pageNoOne <= 1){
			$("#clientelePreviousPageLi").attr("class","disabled");
		}
		if(pageNoOne >= countOne/pageSizeOne){
			$("#clienteleNextPageLi").attr("class","disabled");
		}
		$.jBox.close(jBoxStorageInfo);
		ejectStorageInfo();
	});
}

/**
 * 供应商下一页
 */
$("#clienteleNextPage").live("click",function(){
	if(pageNoOne < countOne/pageSizeOne){
		$("#clienteleTbody").html("");
		$.getJSON("/jeesite/a/en/inStorageDetail/supplierList","pageNo="+(pageNoOne+1)+"&name="+supplierName,function(data){
			if (typeof(data.list) != "undefined" && data.list.length >= 1){
				$.each(data.list, function(i,info){
					newRows += '<tr><td style="width: 8px;"><input type="radio"class="subBox" name="radio" value="'+info.id+'"/></td><td>'+info.name+'</td>'
						+'<td>'+info.phone+'</td>'
						+'<td>'+info.email+'</td>'
						+'<td>'+info.phone+'</td>'
						+'<td>'+info.address+'</td>'
						+'<td>'+info.website+'</td>';
				});
			}
			pageNoOne = data.pageNo;
			pageSizeOne = data.pageSize;
			countOne = data.count;
			$("#clientelePageNo").html(pageNoOne);
			$("#clientelePageSize").html(pageSizeOne);
			$("#clienteleCount").html(countOne);
			$("#clientelePreviousPageLi").attr("class","");
			if(pageNoOne <= 1){
				$("#clientelePreviousPageLi").attr("class","disabled");
			}
			if(pageNoOne >= countOne/pageSizeOne){
				$("#clienteleNextPageLi").attr("class","disabled");
			}
			$.jBox.close(jBoxClienteleInfo);
			ejectClienteleInfo();
		});
	}
});

/**
* 供应商上一页
*/
$("#clientelePreviousPage").live("click",function(){
	if(pageNoOne > 1){
		$("#clienteleTbody").html("");
		$.getJSON("/jeesite/a/en/inStorageDetail/supplierList","pageNo="+(pageNoOne-1)+"&name="+supplierName,function(data){
			if (typeof(data.list) != "undefined" && data.list.length >= 1){
				$.each(data.list, function(i,info){
					newRows += '<tr><td style="width: 8px;"><input type="radio"class="subBox" name="radio" value="'+info.id+'"/></td><td>'+info.name+'</td>'
						+'<td>'+info.phone+'</td>'
						+'<td>'+info.email+'</td>'
						+'<td>'+info.phone+'</td>'
						+'<td>'+info.address+'</td>'
						+'<td>'+info.website+'</td>';
				});
			}
			pageNoOne = data.pageNo;
			pageSizeOne = data.pageSize;
			countOne = data.count;
			$("#clientelePageNo").html(pageNoOne);
			$("#clientelePageSize").html(pageSizeOne);
			$("#clienteleCount").html(countOne);
			$("#clienteleNextPageLi").attr("class","");
			if(pageNoOne <= 1){
				$("#clientelePreviousPageLi").attr("class","disabled");
			}
			if(pageNoOne >= countOne/pageSizeOne){
				$("#clienteleNextPageLi").attr("class","disabled");
			}
			$.jBox.close(jBoxClienteleInfo);
			ejectClienteleInfo();
		});
	}
});


/**
 * 双击选择库位信息
 */
$("#storageLocalName").live('dblclick',function(){
	$("#storageTbody").html("");
	var newRows = '';
	 $.getJSON("/jeesite/a/en/inStorageDetail/storageLocalList",function(data){
		 if (typeof(data.list) != "undefined" && data.list.length >= 1){
			 $.each(data.list, function(i,info){
				newRows += '<tr><td style="width: 8px;"><input type="radio"class="subBox" name="radio" value="'+info.id+'"/></td><td>'+info.name+'</td>';
				if(typeof(info.entrepot) == "undefined" || typeof(info.entrepot.name) == "undefined"){
					newRows += '<td></td>';
				}else{
					newRows += '<td>' + info.entrepot.name + '</td>';
				}
				if(typeof(info.storageType) == "undefined" || typeof(info.storageType.name) == "undefined"){
					newRows += '<td></td>';
				}else{
					newRows += '<td>' + info.storageType.name + '</td>';
				}
				newRows += '<td>' + info.code + '</td>';
				if(typeof(info.forbiddenFlag) != "undefined" && info.forbiddenFlag == 1){
					newRows += '<td>开启</td>';
				}else if(typeof(info.forbiddenFlag) != "undefined" && info.forbiddenFlag == 0){
					newRows += '<td>关闭</td>';
				}else{
					newRows += '<td></td>';
				}
			});
		}
		$("#storageTbody").append(newRows);
		pageNoOne = data.pageNo;
		pageSizeOne = data.pageSize;
		countOne = data.count;
		$("#clientelePageNo").html(pageNoOne);
		$("#clientelePageSize").html(pageSizeOne);
		$("#clienteleCount").html(countOne);
		if(pageNoOne <= 1){
			$("#clientelePreviousPageLi").attr("class","disabled");
		}
		if(pageNoOne >= countOne/pageSizeOne){
			$("#clienteleNextPageLi").attr("class","disabled");
		}
		//弹出选择框
		ejectStorageInfo();
	 });
});





/**
 * 删除
 */
$(".deleteRow").live("click",function(){
	var obj = $(this);
	var submit = function (v, h, f) {
		if (v == 'ok'){ 
			dIds[i] = $(obj).parent().parent().children("td:eq(0)").children("input:eq(1)").val();
			i++;
			$(obj).parent().parent().remove();
		}else if (v == 'cancel'){
			return true;
		}
	};
	$.jBox.confirm("确认删除此信息吗？", "提示", submit); 
}); 

/**
 * 搜索库位
 * @param obj
 */
function selectStorage(obj){
	storageLocalName = $(obj).prev().val();
	$("#clienteleTbody").html(" ");
	var  newRow = "";
	$.getJSON("/jeesite/a/en/inStorageDetail/storageLocalList","name="+storageLocalName,function(data){
		if (typeof(data.list) != "undefined" && data.list.length >= 1){
			 $.each(data.list, function(i,info){
				newRows += '<tr><td style="width: 8px;"><input type="radio"class="subBox" name="radio" value="'+info.id+'"/></td><td>'+info.name+'</td>';
				if(typeof(info.entrepot) == "undefined" || typeof(info.entrepot.name) == "undefined"){
					newRows += '<td></td>';
				}else{
					newRows += '<td>' + info.entrepot.name + '</td>';
				}
				if(typeof(info.storageType) == "undefined" || typeof(info.storageType.name) == "undefined"){
					newRows += '<td></td>';
				}else{
					newRows += '<td>' + info.storageType.name + '</td>';
				}
				newRows += '<td>' + info.code + '</td>';
				if(typeof(info.forbiddenFlag) != "undefined" && info.forbiddenFlag == 1){
					newRows += '<td>开启</td>';
				}else if(typeof(info.forbiddenFlag) != "undefined" && info.forbiddenFlag == 0){
					newRows += '<td>关闭</td>';
				}else{
					newRows += '<td></td>';
				}
			});
		}
		$("#storageTbody").append(newRow);
		pageNoOne = data.pageNo;
		pageSizeOne = data.pageSize;
		countOne = data.count;
		$("#clientelePageNo").html(pageNoOne);
		$("#clientelePageSize").html(pageSizeOne);
		$("#clienteleCount").html(countOne);
		if(pageNoOne <= 1){
			$("#clientelePreviousPageLi").attr("class","disabled");
		}
		if(pageNoOne >= countOne/pageSizeOne){
			$("#clienteleNextPageLi").attr("class","disabled");
		}
		$.jBox.close(jBoxStorageInfo);
		ejectStorageInfo();
	});
}

/**
 * 库位下一页
 */
$("#clienteleNextPage").live("click",function(){
	if(pageNoOne < countOne/pageSizeOne){
		$("#clienteleTbody").html("");
		$.getJSON("/jeesite/a/en/inStorageDetail/storageLocalList","pageNo="+(pageNoOne+1)+"&name="+storageLocalName,function(data){
			if (typeof(data.list) != "undefined" && data.list.length >= 1){
				 $.each(data.list, function(i,info){
					newRows += '<tr><td style="width: 8px;"><input type="radio"class="subBox" name="radio" value="'+info.id+'"/></td><td>'+info.name+'</td>';
					if(typeof(info.entrepot) == "undefined" || typeof(info.entrepot.name) == "undefined"){
						newRows += '<td></td>';
					}else{
						newRows += '<td>' + info.entrepot.name + '</td>';
					}
					if(typeof(info.storageType) == "undefined" || typeof(info.storageType.name) == "undefined"){
						newRows += '<td></td>';
					}else{
						newRows += '<td>' + info.storageType.name + '</td>';
					}
					newRows += '<td>' + info.code + '</td>';
					if(typeof(info.forbiddenFlag) != "undefined" && info.forbiddenFlag == 1){
						newRows += '<td>开启</td>';
					}else if(typeof(info.forbiddenFlag) != "undefined" && info.forbiddenFlag == 0){
						newRows += '<td>关闭</td>';
					}else{
						newRows += '<td></td>';
					}
				});
			}
			pageNoOne = data.pageNo;
			pageSizeOne = data.pageSize;
			countOne = data.count;
			$("#clientelePageNo").html(pageNoOne);
			$("#clientelePageSize").html(pageSizeOne);
			$("#clienteleCount").html(countOne);
			$("#clientelePreviousPageLi").attr("class","");
			if(pageNoOne <= 1){
				$("#clientelePreviousPageLi").attr("class","disabled");
			}
			if(pageNoOne >= countOne/pageSizeOne){
				$("#clienteleNextPageLi").attr("class","disabled");
			}
			$.jBox.close(jBoxClienteleInfo);
			ejectClienteleInfo();
		});
	}
});

/**
* 库位上一页
*/
$("#clientelePreviousPage").live("click",function(){
	if(pageNoOne > 1){
		$("#clienteleTbody").html("");
		$.getJSON("/jeesite/a/en/inStorageDetail/storageLocalList","pageNo="+(pageNoOne-1)+"&name="+storageLocalName,function(data){
			if (typeof(data.list) != "undefined" && data.list.length >= 1){
				 $.each(data.list, function(i,info){
					newRows += '<tr><td style="width: 8px;"><input type="radio"class="subBox" name="radio" value="'+info.id+'"/></td><td>'+info.name+'</td>';
					if(typeof(info.entrepot) == "undefined" || typeof(info.entrepot.name) == "undefined"){
						newRows += '<td></td>';
					}else{
						newRows += '<td>' + info.entrepot.name + '</td>';
					}
					if(typeof(info.storageType) == "undefined" || typeof(info.storageType.name) == "undefined"){
						newRows += '<td></td>';
					}else{
						newRows += '<td>' + info.storageType.name + '</td>';
					}
					newRows += '<td>' + info.code + '</td>';
					if(typeof(info.forbiddenFlag) != "undefined" && info.forbiddenFlag == 1){
						newRows += '<td>开启</td>';
					}else if(typeof(info.forbiddenFlag) != "undefined" && info.forbiddenFlag == 0){
						newRows += '<td>关闭</td>';
					}else{
						newRows += '<td></td>';
					}
				});
			}
			pageNoOne = data.pageNo;
			pageSizeOne = data.pageSize;
			countOne = data.count;
			$("#clientelePageNo").html(pageNoOne);
			$("#clientelePageSize").html(pageSizeOne);
			$("#clienteleCount").html(countOne);
			$("#clienteleNextPageLi").attr("class","");
			if(pageNoOne <= 1){
				$("#clientelePreviousPageLi").attr("class","disabled");
			}
			if(pageNoOne >= countOne/pageSizeOne){
				$("#clienteleNextPageLi").attr("class","disabled");
			}
			$.jBox.close(jBoxClienteleInfo);
			ejectClienteleInfo();
		});
	}
});